#ifndef __IBASE_BUSINESS_OPERATION__
#define __IBASE_BUSINESS_OPERATION__

#include "IObject.h"
#include "IDataConnect.h"
#include "IPacket.h"

class IBussinessOperation : public virtual IObject
{
public:
    virtual IConnect * InitConnect(const char * pszConClsName, const char * pszDbConnectTxt, char * pszDataConnectId, int iLen) = 0;
    virtual IConnect * Connect(const char * pszDataConnectId) = 0;
    virtual const bool RunLbmFlg(void * ptrTask, const char * pszLbmNo) = 0;
    virtual const bool UnpackingForStkCode(void * ptrResult, void * ptrResultSet) = 0;
	virtual const void AddDataConnectId(unsigned long long ullProId, const char * pszDataConnectId) = 0;
	virtual const char * GetDataConnectId(unsigned long long ullProId) = 0;
	virtual const bool DelDataConnectId(unsigned long long ullProId) = 0;
};

class ILinkMiddleWare : public virtual IObject
{
public:
	virtual void LinkMiddleWare(const char * pszDataConnectId, const char * pszConTxt, IPacket * ptrRetVal) = 0;
};

class IProcessMessage : public virtual IObject
{
public:
    virtual const bool ProcessMessage(IPacket * ptrPkt, IValueSet & ptrValueSet, bool &refbFreeFlg) = 0;
};

class IDisposeTask : public virtual IObject
{
public:
	virtual const char * Info(const long long iPubId) = 0;
	virtual const void AddTask(IPacket * ptrPkt) = 0;
	virtual const void GetTask(void * ptrMpTask) = 0;
	virtual const void RunTask(void * ptrMpTaskRetVal, IValueSet & ptrValueSet) = 0;
	virtual const void DisposeTask(void * ptrMpTaskRetVal, void * ptrVtRetVal) = 0;
	virtual const void SendTask(void * ptrVtRetVal, IInterProcessCommunication * ptrIpc) = 0;
	virtual const void UnSubCorpsePid(IValueSet & ptrValueSet) = 0;
	virtual const void UnSub(IPacket * ptrRetVal, IValueSet & ptrValueSet) = 0;
	virtual const int Id() = 0;
	virtual const void SetId(const int iIdx) = 0;
};

class IDispTaskMan : public virtual IObject
{
public:
	virtual const bool CreateDisposeTask(const char * pszName, int &iIdx) = 0;
	virtual const char * InfoByDisposeId(const long long iIdx, const long long iPubId) = 0;
	virtual const void AddTaskById(const long long iIdx, IPacket * ptrPkt) = 0;
	virtual const void GetTaskById(const long long iIdx, void * ptrMpTaskRetVal) = 0;
	virtual const void RunTaskById(const long long iIdx, void * ptrMpTaskRetVal, IValueSet & ptrValueSet) = 0;
	virtual const void DisposeTaskById(const long long iIdx, void * ptrMpTaskRetVal, void * ptrVtRetVal) = 0;
	virtual const void SendTaskById(const long long iIdx, void * ptrVtRetVal) = 0;
	virtual const void UnSubCorpsePidById(const long long iIdx, IValueSet & ptrValueSet) = 0;
	virtual const void UnSubById(const long long iIdx, IPacket * ptrRetVal, IValueSet & ptrValueSet) = 0;
};

#define CREATE_INSTANCE_DISP_TASK_MAN Invoke<IDispTaskMan>("CDispTaskMan", nullptr, nullptr, 0);\

#define CREATE_PTR_DISP_TASK_MAN(ptr)\
  shared_ptr<CDispTaskMan> ptr = CREATE_INSTANCE_DISP_TASK_MAN\ 

#define CREATE_DISP_TASK_MAN(ptr)\
  ptr = CREATE_INSTANCE_DISP_TASK_MAN\

#endif//__IBASE_BUSINESS_OPERATION__